package com.powernode;

import com.powernode.util.TokenUtil;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@SpringBootApplication
@EnableDubbo
/*启动swagger*/
@EnableSwagger2
public class MicrWebApplication {

    @Value("${token.secretKey}")
    private String tokenSecretKey;

    public static void main(String[] args) {
        SpringApplication.run(MicrWebApplication.class, args);
    }

    @Bean
    public TokenUtil tokenUtil(){
        TokenUtil tokenUtil = new TokenUtil(tokenSecretKey);
        return tokenUtil;
    }

}
